<template>
  <myHeader v-if="show" />
  <router-view></router-view>
  <myFooter v-if="show" />
</template>

<script setup>
import myHeader from "@comps/Header/Header.vue";
import myFooter from "@comps/Footer/Footer.vue";

import { useRoute } from "vue-router";
import { useStore } from "vuex";
import { computed, onMounted } from "vue";

const $route = useRoute();
const $store = useStore();
let show = computed(() => {
  let path = $route.path;
  if (path == "/login" || path == "/register") {
    return false;
  }
  return true;
});
//生命周期函数
onMounted(() => {
  $store.dispatch("getCategoryList"); //获取CategoryList数据
});
</script>
<style></style>
